package com.service.component.log.controller;


import com.service.component.common.CommonResult;
import com.service.component.common.enumerate.OperateTypeEnum;
import com.service.component.log.aspect.SysOperateLog;
import com.service.component.log.entity.SysOperate;
import com.service.component.log.services.SysOperateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("log")
@Api("系统操作日志")
/**
 * @author ：Calvin
 * @date ：Created in 2021/7/16 14:35
 * @description：系统操作日志
 * @modified By：
 * @version: 1.0.0$
 */
@Valid
public class SysOperateController {

    @Autowired
    private SysOperateService sysOperateService;

    @ApiOperation(value = "查询系统操作日志记录",notes = "查询系统操作日志记录")
    @GetMapping(value = "selectSyslog",produces ={"application/json;charset=UTF-8"} )
    @SysOperateLog(descrption = "根据SysOperate查询所有SysOperate",operateType = OperateTypeEnum.QUERY)
    public List<SysOperate> selectSyslog(SysOperate sysOperate){
        return sysOperateService.selectSyslog(sysOperate);
    }

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("aaaa");
        list.add("bbbb");
        list.add("fff");
        list.add("ada");
        list.add("aaaa");
        list.add("ffff");
        System.out.println(list.indexOf("aaaa"));
        System.out.println(list.indexOf("fff"));
        System.out.println(list.indexOf("ada"));
    }
}
